﻿/// <reference name="MicrosoftAjax.js"/>
/// <reference path="~/Clients/Scripts/jQuery/jquery-1.6.1-vsdoc.js"/>
/// <reference path="~/Clients/Scripts/globals.debug.js"/>
/// <reference path="~/Clients/Scripts/utils.debug.js"/>
/// <reference path="~/Clients/Scripts/errorHandling.debug.js"/>
/// <reference path="~/Clients/Scripts/jQuery/jquery.component.debug.js"/>

Type.registerNamespace("GreeNova");

GreeNova.Disposable = function(obj, disposeFunc) {
    Sys.Application.registerDisposableObject(this);

    this._obj = obj;
    this._disposeFunc = disposeFunc;
};

GreeNova.Disposable.prototype = {
    dispose: function() {
        if (this._disposeFunc)
            this._disposeFunc(this._obj);
        this._obj = null;
    },
    get_obj: function() {
        return this._obj;
    },
    set_obj: function(value) {
        this._obj = value;
    }
};
GreeNova.Disposable.registerClass('GreeNova.Disposable', null, Sys.IDisposable);
